@echo off
%1 %2
ver|find "5.">nul&&goto :Admin
mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :Admin","","runas",1)(window.close)&goto :eof
:Admin

pip install -r %~dp0requirements.txt
mkdir  C:\Users\%USERNAME%\ESPNow
copy /y "%~dp0main.pyw" C:\Users\%USERNAME%\ESPNow\main.pyw
copy /y "%~dp0record.py" C:\Users\%USERNAME%\ESPNow\record.py
copy /y "%~dp0screenshot.py" C:\Users\%USERNAME%\ESPNow\screenshot.py
copy /y "%~dp0sendrecv.py" C:\Users\%USERNAME%\ESPNow\sendrecv.py
copy /y "%~dp0weather.py" C:\Users\%USERNAME%\ESPNow\weather.py
schtasks /create /tn "ESPNow" /sc ONLOGON /tr "pythonw C:\Users\%USERNAME%\ESPNow\main.pyw"
schtasks.exe /run /tn "ESPNow" 

echo Service has been installed
pause >nul